package com.swq.java.code;

import java.io.File;
import java.nio.file.Paths;

/**
 * @author xi.yang
 * @create 2019-03-18 14:33
 **/
public class AddCodeTest {
    private static final String PATH = Paths.get(System.getProperty("user.dir"), "java_obj_code", "src", "main", "java", "com", "swq", "java", "code", "chapter").toString();
    private static final int CHAPTER = 8;

    public static void main(String[] args) {
        String chapterStr = CHAPTER >= 10 ? "" + CHAPTER : "0" + CHAPTER;
        int start = 1;
        int end = 4;
        for (int i = start; i <= end; i++) {
            String tag = "code" + (i >= 10 ? "" : "0") + i;
            File file = new File(PATH + chapterStr + File.separator + tag);
            file.mkdirs();
        }
        File file = new File(PATH + chapterStr + File.separator + "other");
        file.mkdirs();
    }
}
